Skip to content

Content scanner: scan timeline events for unsafe content#7159

Draft
jmartinesp wants to merge 27 commits into
developfrom
feat/content-scanner-manual-scan-timeline
Draft

Content scanner: scan timeline events for unsafe content#7159
jmartinesp wants to merge 27 commits into
developfrom
feat/content-scanner-manual-scan-timeline

Conversation

@jmartinesp

Copy link
Copy Markdown
Member

Content

Second iteration of content scanner: scan timeline events and display errors for dangerous ones.

Based on #7139

Motivation and context

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • I am aware of the etiquette.
  • This PR was made with the help of AI:
    • Yes. In this case, please request a review by Copilot.
    • No.
  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly defines what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@jmartinesp jmartinesp added the PR-Wip For anything that isn't ready to ship and will be enabled at a later date label Jul 6, 2026
@jmartinesp jmartinesp changed the title Use MockWebServer in DefaultWellknownRetrieverTest Content scanner: scan timeline events for unsafe content Jul 6, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/BwDrFJ

@jmartinesp jmartinesp added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Jul 7, 2026
@github-actions github-actions Bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Jul 7, 2026
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.03338% with 187 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.46%. Comparing base (3642065) to head (dd39549).

Files with missing lines Patch % Lines
...omponents/event/TimelineItemAttachmentsListView.kt 43.58% 14 Missing and 8 partials ⚠️
...ontentscanner/impl/DefaultContentScannerService.kt 0.00% 18 Missing ⚠️
...meline/components/event/TimelineItemGalleryView.kt 48.38% 10 Missing and 6 partials ⚠️
...sages/impl/timeline/util/AsyncImageStateHandler.kt 14.28% 5 Missing and 7 partials ⚠️
...timeline/components/event/TimelineItemVoiceView.kt 85.07% 3 Missing and 7 partials ⚠️
.../media/contentvalidation/ContentValidationState.kt 82.00% 6 Missing and 3 partials ⚠️
...ies/matrix/api/timeline/item/event/EventContent.kt 55.55% 2 Missing and 6 partials ⚠️
...res/contentscanner/impl/di/ContentScannerModule.kt 0.00% 7 Missing ⚠️
...timeline/components/event/TimelineItemVideoView.kt 88.33% 3 Missing and 4 partials ⚠️
...s/impl/timeline/components/TimelineItemEventRow.kt 88.46% 1 Missing and 5 partials ⚠️
... and 20 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7159      +/-   ##
===========================================
- Coverage    80.54%   80.46%   -0.09%     
===========================================
  Files         2692     2722      +30     
  Lines        77958    78829     +871     
  Branches     10530    10721     +191     
===========================================
+ Hits         62794    63431     +637     
- Misses       11089    11259     +170     
- Partials      4075     4139      +64     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jmartinesp jmartinesp force-pushed the feat/content-scanner-integration branch from 0271e0c to 2ada023 Compare July 8, 2026 06:57
Base automatically changed from feat/content-scanner-integration to develop July 8, 2026 07:50
@jmartinesp jmartinesp force-pushed the feat/content-scanner-manual-scan-timeline branch 3 times, most recently from f98ed05 to c97c235 Compare July 8, 2026 16:10
jmartinesp and others added 19 commits July 8, 2026 19:19
…later handle them and check why some media didn't load
…ontent's validation state in any UI component inside the chat screen
…s for images, videos and stickers, so we can check if the thumbnail had already been validated
…on state: invalid contents will display a red background and border
…`eventId`, needed for the content validation
…imeline items, besides the thumbnails that are displayed
@jmartinesp jmartinesp force-pushed the feat/content-scanner-manual-scan-timeline branch from b0da020 to 143d596 Compare July 8, 2026 17:19
@ElementBot

ElementBot commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator
Warnings
⚠️

You have made changes to a file containing a @Preview annotated function but its package name prefix is not included in the ComposablePreviewProvider.
Packages missing in tests/uitests/src/test/kotlin/base/ComposablePreviewProvider.kt:

  • io.element.android.tests.konsist
Messages
📖 This pull request seems relatively large. Please consider splitting it into multiple smaller ones.

Generated by 🚫 dangerJS against dd39549

@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@thorw4ld

thorw4ld commented Jul 8, 2026

Copy link
Copy Markdown

what is this content scanner feature about? is all the media i send in a private chat now being scanned? how does it decide whats dangerous?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Wip For anything that isn't ready to ship and will be enabled at a later date

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants